package com.cloud.code.dynaproxy.aop;

import java.util.Calendar;

public class MyAdvice implements Advice{

    private long startTime;

    @Override
    public void beforeDo() {
        startTime = Calendar.getInstance().getTimeInMillis();
        System.out.println("start Time :" + startTime);
    }

    @Override
    public void afterDo() {
        long endTime = Calendar.getInstance().getTimeInMillis();
        System.out.println("end Time :" + endTime);
        System.out.println("total Time: " + (endTime-startTime) + "s");
    }
}
